package com.movitech.mobile.cz.base.purchase.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.movitech.mobile.cz.base.common.util.CommonConstants;
import com.movitech.mobile.cz.base.purchase.entity.WFlowFormBidDelayHistory;
import com.movitech.mobile.cz.base.purchase.mapper.WFlowFormBidDelayHistoryMapper;
import com.movitech.mobile.cz.base.purchase.service.WFlowFormBidDelayHistoryService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 流程表单-延标 服务实现类
 * </p>
 *
 * @author Movitech Mobile
 * @since 2018-03-15
 */
@Service
public class WFlowFormBidDelayHistoryServiceImpl extends ServiceImpl<WFlowFormBidDelayHistoryMapper, WFlowFormBidDelayHistory> implements WFlowFormBidDelayHistoryService {

    @Override
    public List<WFlowFormBidDelayHistory> findByTypeAndFormId(String formId, int type) {
        WFlowFormBidDelayHistory wFlowFormBidDelayHistory = new WFlowFormBidDelayHistory();
        wFlowFormBidDelayHistory.setFlowFormId(formId);
        wFlowFormBidDelayHistory.setDelFlag(CommonConstants.DEL_FLAG_NORMAL);
        wFlowFormBidDelayHistory.setBidDelayType(type);
        EntityWrapper entityWrapper = new EntityWrapper();
        entityWrapper.setEntity(wFlowFormBidDelayHistory);
        entityWrapper.orderBy("create_date",false);
        return selectList(entityWrapper);
    }
}
